//
//  ViewController.m
//  UI13_可视化编程xib文件使用
//
//  Created by Scott on 16/3/25.
//  Copyright © 2016年 Scott. All rights reserved.
//

#import "ViewController.h"
#import "VCOfSecond.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    
    self.navigationItem.title = @"首页";
    
    self.navigationItem.rightBarButtonItem = [[[UIBarButtonItem alloc] initWithTitle:@"下一页" style:UIBarButtonItemStylePlain target:self action:@selector(handleNext:)] autorelease];
}


#pragma mark - 知识点1: 使用xib文件.
- (void)handleNext:(UIBarButtonItem *)button {
    
    // 从xib文件初始化
    VCOfSecond *second = [[VCOfSecond alloc] initWithNibName:@"VCOfSecond" bundle:[NSBundle mainBundle]];
    
    [self.navigationController pushViewController:second animated:YES];
    
    [second release];
    
}

#pragma mark -
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
